package com.program.beautymakeup.controller.wxController;

import com.program.beautymakeup.domain.vo.ResultInfo;
import com.program.beautymakeup.service.PortfolioTypeService;
import com.program.beautymakeup.service.UserService;
import com.program.beautymakeup.utils.ResultInfoUtil;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author bytedance
 * @ClassName userInfoController.java
 * @Description TODO
 * @createTime 2023年02月09日 22:34:00
 */
@Slf4j
@RestController
@RequiredArgsConstructor
@RequestMapping("/userInfo")
public class UserInfoController {

    @Autowired
    private UserService userService;

    @Autowired
    private PortfolioTypeService portfolioTypeService;

    @GetMapping("/")
    public ResultInfo getUserInfo(@RequestParam("userId") Integer userId) {
        return ResultInfoUtil.buildSuccess(userService.getUserInfo(userId));
    }

    @GetMapping("/portfolioMakeup")
    public ResultInfo getPortfolioMakeup(@RequestParam("userId") Integer userId) {
        return ResultInfoUtil.buildSuccess(portfolioTypeService.getPortfolioMakeup(userId));
    }
}
